<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>05</title>
</head>
<body>
<div>
  <ul>
    <!--v-for 循环遍历-->
    <li v-for="name in arr">{{name}}</li>
  </ul>

  <table border="1">
    <caption>人物列表</caption>
    <tr>
      <th>编号</th><th>名字</th><th>年龄</th><th>类型</th>
    </tr>
    <tr v-for="(p,i) in persons">
      <td>{{i+1}}</td><td>{{p.name}}</td><td>{{p.age}}</td><td>{{p.type}}</td>
    </tr>
  </table>

  <table border="1">
    <caption>员工列表</caption>
    <tr>
      <th>编号</th>
      <th>姓名</th>
      <th>工作</th>
      <th>工资</th>
    </tr>
    <tr v-for="(emp,i) in empArr">
      <td>{{i+1}}</td>
      <td>{{emp.name}}</td>
      <td>{{emp.job}}</td>
      <td>{{emp.salary}}</td>
    </tr>
  </table>
</div>

<script src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
<script>
  let v = new Vue({
    el:"body>div",
    data:{
      arr:["姜桑","大帅","阿磊"],
      persons:[{name:"姜大儿",age:"500",type:"野生"},{name:"郭老二",age:"400",type:"杂交"},{name:"孙大帅",age:"300",type:"军阀"}],
      empArr:[{name:"张三",job:"销售",salary:"5000",age:"40"},
        {name:"李四",job:"人事",salary:"4000",age:"30"},
        {name:"王五",job:"出纳",salary:"3000",age:"20"},
        {name:"赵六",job:"程序员",salary:"20000",age:"28"}]
    }
  })
</script>
</body>
</html>